

//
//  HAOrderTableViewCell.m
//  HorsemanApp
//
//  Created by qyc on 2019/7/28.
//  Copyright © 2019 q. All rights reserved.
//

#import "HAOrderTableViewCell.h"

@implementation HAOrderTableViewCell

- (void)awakeFromNib {
    [super awakeFromNib];
    // Initialization code
}

- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];

    // Configure the view for the selected state
}

- (void)createCellDataWithModel:(HAOrderModel *)model {
    self.time.text = [NSString stringWithFormat:@"预计%@送达",model.send_time];
    self.adress.text = [NSString stringWithFormat:@"%@%@",model.address_data.name,model.address.door_num];
    // 性别
    switch (model.address.sex) {
        case 1:
            self.name.text = [NSString stringWithFormat:@"%@（先生）  %@",model.address.name, model.address.tel];
            break;
        case 2:
            self.name.text = [NSString stringWithFormat:@"%@（女士）  %@",model.address.name, model.address.tel];
            break;
        default:
            break;
    }
    // 状态
    switch (model.order_status) {
        case UserOrdersProductTypeWithExpressageDelivery:
            self.typeLabel.text = @"退货单";
            break;
        case UserOrdersProductTypeWithHorsemanReceiving:
            self.typeLabel.text = @"新订单";
            break;
        default:
            break;
    }
}

- (IBAction)mapSender:(id)sender {
    UIButton *btn = (UIButton *)sender;
    if (_goSelect) {
        _goSelect(btn.tag);
    }
}

- (IBAction)contactSender:(id)sender {
    UIButton *btn = (UIButton *)sender;
    if (_goSelect) {
        _goSelect(btn.tag);
    }
}

- (IBAction)stateSender:(id)sender {
    UIButton *btn = (UIButton *)sender;
    if (_goSelect) {
        _goSelect(btn.tag);
    }
}
@end
